package de.hska.pwmanager.persistence.model.dao;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;
import org.synyx.hades.dao.GenericDao;
import org.synyx.hades.dao.Modifying;
import org.synyx.hades.dao.Query;

import de.hska.pwmanager.persistence.model.*;

public interface PasswordUserHashDao extends GenericDao<PasswordUserHash , Long> {
	@Modifying
	@Transactional
	@Query("update PasswordUserHash u set u.user = ?1 where u.id = ?2")
	int setUser(User userID, Long id);
	
	@Query("SELECT pwhash FROM PasswordUserHash pwhash where pwhash.user = ?1")
	public List<PasswordUserHash> getHashesOfUser(User user);
}
